﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ComerciosDestacados.aspx.cs" Inherits="Web_Guia_Digital_Georeferenciada.ComerciosDestacados" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Comercios mejor valorados</title>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css" />
    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type = "text/javascript"></script>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel = "Stylesheet" type="text/css" />
    <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
      <script src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry" type="text/javascript"></script>   
    <link rel="stylesheet" href="Content/bootstrap.min.css" type="text/css" /> 
    <script type="text/javascript" src="Content/bootstrap.min.js"></script>
<script type ="text/javascript">
    var Items = [];


    function cargarLista() {

        $.ajax({
            type: "POST",
            url: '<%=ResolveUrl("~/Mantenimientos/ServiciosAutocompletado.asmx/ComerciosDestacados") %>',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) {
                jQuery.each(data, function (index, item) {
                    armarLista(item);
                });
            },
            error: SetTabSessionValueFailed
        });

    }

    function armarLista(item) {
        if (item.length > 0) {
            for (var i = 0; i <= item.length; i++) {
                $("#listado").append('<a href="#" class="list-group-item active"> ' +
                        '<h4 class="list-group-item-heading"><b>Nombre del comercio:    </b>' + item[i].ComercioNombre + "</h4> <br /> " +
                        '<p class="list-group-item-text"><b>Dirección:    </b>' + item[i].ComercioDireccion + "</p> <br /> " +
                        '<p class="list-group-item-text"><b>Telefono:    </b>' + item[i].ComercioTelefono + "</p> </a>");
            }
        }
    }
    function SetTabSessionValueFailed() {
        alert('call failed');
    }
</script>
    <style>
        #listado {
           position:relative;
           display:inline-block;
           width: 75%;
           height: 50%;
           left: 10%;       
        }
    </style>
</head>
<body onload="cargarLista();">
    <br/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Label ID="lblTitulo" runat="server" Text="Comercios destacados" Font-Size="X-Large" Font-Bold="True"></asp:Label>    
    <br />
    <br />
    <br />
<div class="list-group" id="listado" runat="server" >
  
</div>
</body>
</html>
